package com.michale.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.michale.common.domain.operate.OperateLogEntity;
import com.michale.system.mapper.operate.OperateLogMapper;
import com.michale.system.service.OperateLogService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Michale
 * @apiNote  操作日志记录 实现层
 */
@Service("operaLogService")
public class OperateLogServiceImpl extends ServiceImpl<OperateLogMapper, OperateLogEntity> implements OperateLogService {

    /**
     * 新增操作日志
     *
     * @param sysOperaLog 操作日志对象
     */
    @Override
    public void insertOperable(OperateLogEntity sysOperaLog) {
        baseMapper.insert(sysOperaLog);
    }

    /**
     * 查询操作日志集合
     *
     * @param operateLogEntity 分页查询参数
     * @return 操作日志集合
     */
    @Override
    public List<OperateLogEntity> selectOperateLogList(OperateLogEntity operateLogEntity) {
        return baseMapper.selectOperateLogList(operateLogEntity);
    }

    /**
     * 批量删除系统操作日志
     *
     * @param operateLogIds 需要删除的操作日志ID
     * @return 结果
     */
    @Override
    public int deleteOperateLogByIds(Long[] operateLogIds) {
        return baseMapper.deleteOperateLogByIds(operateLogIds);
    }

    /**
     * 清空操作日志记录
     *
     * @return 结果
     */
    @Override
    public void cleanOperateLog() {
        baseMapper.cleanOperateLog();
    }
}